import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import {Spin } from 'antd'
import { LoadingOutlined } from '@ant-design/icons';

let defaultState = {show:false}

class Progress extends Component {
	
  constructor(props){
        super(props)
        this.state = {...defaultState}
    }

  start(){ // 开始显示
    this.setState({
      show:true
    })
  }

  done(){ // 结束隐藏
    this.setState({
      show:false
    })
  }
  render(){
    return (
      <div className="myprogress" style={this.state.show? {display:'block'}:{display:'none'}}>
		<div id="load" style={{
		position:"absolute",
		left:0,
		top:0,
		width:"40px",
		height:"40px",
		right:0,
		bottom:0,
		margin:"auto",
		zIndex: 999,
		border:"2px solid red",
		background:"#fff"}}
		>
			<Spin indicator={<LoadingOutlined style={{ fontSize: 34 }} spin />} />
		</div>
		
		
		

		
		
      </div>
      )
  }

}

// 创建元素追加到body
let div = document.createElement('div');
let props = {
};
document.body.appendChild(div);
 
let Box = ReactDOM.render(React.createElement(
  Progress,
  props
),div);
export default Box;